package com.nbk.composition.utils

import java.text.SimpleDateFormat

/**
 * Author:  LuoHaoLun
 * Email :  506503279@qq.com
 * Date  :  2021/5/27
 */
private val timeFormat by lazy { SimpleDateFormat("yyyy-MM-dd HH:mm:ss") }
fun getCurrentTime() = timeFormat.format(System.currentTimeMillis())


fun createBatchNumber(): String {
    val number = (0..99).random()
    return SimpleDateFormat("yyyyMMddHHmmss").format(System.currentTimeMillis()) + if (number < 10) "0$number" else number
}